  require 'find'
  require 'fileutils'

  include FileUtils::Verbose
  from_dir = File.expand_path( ARGV[0] ) + "/" 
  to_dir = File.expand_path( ARGV[1] ) + "/" 

  makedirs( to_dir )
  chdir( to_dir ) do
    Find.find( from_dir ) do |path|
      fname = path.sub( from_dir, '' )
      fdir, base = File.split( fname )
      if FileTest.directory? path
        Find.prune if base[0] == ?. or 
                    base =~ /^(?:CVS|images|Old|Trash|delme|bak)/i
        makedirs( fname )
      elsif FileTest.file? path
        unless base =~ /(?:\.jpg|\.jpeg|\.pdf|\.gif|\.psd|~)$/
          copy path, fname
        end
      end
    end
  end
